import java.util.ArrayList;
import java.util.List;

public class Demo1 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(10-i);
        }
        list.forEach((x)-> System.out.print(x + " "));
        System.out.println();
        list.sort((o1, o2) -> o1 - o2);
        list.forEach((x)-> System.out.print(x + " "));
    }
}
